<?php 
class History_model extends CI_Model
{
	public function myhistory($memid)
	{
		$array = array('memid' => $memid);
		$query = $this->db->get_where('reservation', $array);
		
		if($query->num_rows() > 0)
		{
			foreach ($query->result() as $row) {
				$data[] = $row;
			}
			return $data;
		}
	}
	
	public function get_by_status($memid, $resstatus)
	{
	$array = array('memid' => $memid, 'resstatus' => $resstatus);
		$query = $this->db->get_where('reservation', $array);
		
		if($query->num_rows() > 0)
		{
			foreach ($query->result() as $row) {
				$data[] = $row;
			}
			return $data;
		}
	}
}